/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: Hua YY
 * Date: 2025-02-04
 * Time: 22:26
 */
class Solution7 {
    public int mySqrt(int x) {
        long i = 0;
        long result = 0;
        while(true){
            long num1 = (long)Math.pow(i,2);
            long num2 = (long)Math.pow(i+1,2);
            if(num1 <= x && num2 > x){
                result = i;
                break;
            }else{
                i++;
            }
        }
        return (int)result;

    }
}
public class Test7 {
}
